package com.harry.demo11;

import org.activiti.api.task.model.builders.TaskPayloadBuilder;
import org.activiti.api.task.runtime.TaskRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * 作者
 */
@SpringBootApplication
public class Demo11Application implements CommandLineRunner {

    private Logger logger = LoggerFactory.getLogger(Demo11Application.class);

    public static void main(String[] args) {
        SpringApplication.run(Demo11Application.class, args);
    }

    @Autowired
    private TaskRuntime taskRuntime;

    @Override
    public void run(String... args) throws Exception {
        taskRuntime.create(TaskPayloadBuilder.create()
                .withName("First Team Task")
                .withDescription("This is something really important")
                .withCandidateGroup("activitiTeam")
                .withPriority(10)
                .build());
    }
}
